package com.test;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

import com.alibaba.fastjson.JSONObject;


public class FileIs {
	

	//读取记事本数据
	public static void main(String[] args) throws InterruptedException, IOException {
		String path = "C:/Users/domains90/Desktop/";
		String name = "湖北删除人员.txt";
		File file = new File(path+name);
		List<String> list = new LinkedList<>();
		int index = 0;
		StringBuffer bu = new StringBuffer();
		try(BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));){
			String lineTxt = null;
			while ((lineTxt = br.readLine()) != null&&index<10) {	
//				bu.append(String.format("\"%s\",", lineTxt));
				System.err.println(lineTxt);
				list.add(lineTxt);
				index++;
			}			
		}
		//System.err.println(list.size());
//		String[] a =  list.toArray(new String[list.size()]);
//		System.out.println(JSONObject.toJSON(a));
//		System.out.println(bu.toString());
	}

}
